﻿using CNKI.TPI.Web.Admin.Model;
using CNKI.TPI.Web.Search.Model;
using KNet.Data.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CNKI.TPI.Web.Admin.IDAO
{
    public interface IHomeConfigDAO
    {
        /// <summary>
        /// 根据类型获取首页配置信息
        /// </summary>
        /// <returns></returns>
        IList<SYS_CMS_NEWS_NEWSCONTENTCONFIG> GetHomepageConfig(string showtype);
        /// <summary>
        /// 根据数据库类型ID，获取数据库类型
        /// </summary>
        /// <param name="databaseId"></param>
        /// <returns></returns>
        SYS_CMS_RESOURCE_TEMPLATE GetTemplateByID(int datatypeId);
        /// <summary>
        /// 保存设置的栏目
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool SaveContentConfig(SYS_CMS_NEWS_NEWSCONTENTCONFIG obj);
        /// <summary>
        /// 保存设置的跳转栏目
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool SaveContentJump(SYS_CMS_NEWS_JUMPTEMPLATE obj);
        /// <summary>
        /// 修改设置的栏目
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateContentConfig(SYS_CMS_NEWS_NEWSCONTENTCONFIG obj);
        /// <summary>
        /// 修改设置的跳转栏目
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateContentJump(SYS_CMS_NEWS_JUMPTEMPLATE obj);
        /// <summary>
        /// 判断数据库是否已经设置过跳转模板
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="typeid"></param>
        /// <returns></returns>
        bool IsExistJumpByID(int dbid,int showtype);
        /// <summary>
        /// 判断数据库是否已经设置过该栏目
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="typeid"></param>
        /// <returns></returns>
        bool IsExistContentByID(int dbid, int typeid);
        /// <summary>
        /// 修改时，判断排除记录本身
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="typeid"></param>
        /// <param name="sysid"></param>
        /// <returns></returns>
        bool IsExistContentByID(int dbid, int typeid, int sysid);
        /// <summary>
        /// 根据ID获取模板信息
        /// </summary>
        /// <param name="sysid"></param>
        /// <returns></returns>
        IList<SYS_CMS_NEWS_NEWSCONTENTCONFIG> GetHomepageConfigByID(int sysid);
        /// <summary>
        /// 获取调转模板信息
        /// </summary>
        /// <param name="sysid"></param>
        /// <returns></returns>
        IList<SYS_CMS_NEWS_JUMPTEMPLATE> GetHomepageJumpByID(int sysid);
        /// <summary>
        /// 删除模板
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool DeleteContentNew(SYS_CMS_NEWS_NEWSCONTENTCONFIG obj);
        /// <summary>
        /// 删除链接模板
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool DeleteJump(SYS_CMS_NEWS_JUMPTEMPLATE obj);
        bool IsExistJumpByID(int dbid, int typeid, int sysid);
         /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <param name="exp">查询条件</param>
        /// <returns></returns>
        IList<SYS_CMS_NEWS_MENUCONFIG> GetMenuList(ExpressionCombine<SYS_CMS_NEWS_MENUCONFIG> exp, int cacheTime);
        /// <summary>
        /// 添加菜单
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool AddMenu(SYS_CMS_NEWS_MENUCONFIG obj);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool UpdateMenu(SYS_CMS_NEWS_MENUCONFIG obj);
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool DelMenu(SYS_CMS_NEWS_MENUCONFIG obj);
          /// <summary>
        /// 修改菜单显示顺序
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        bool UpdateMenuSort(IList<SYS_CMS_NEWS_MENUCONFIG> list);
         /// <summary>
        /// 更改首页栏目显示顺序
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        bool UpdateHomeSort(IList<SYS_CMS_NEWS_NEWSCONTENTCONFIG> list);
      
    }
}
